home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 051-075 / scopedisk52 / tutor / ci < prev    next >
Text File  |  1995-03-18  |  18KB  |  437 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.     Well, you've gotten this far so you're on the right track.
  8.  
  9.              /* At this time, give thanks to
  10.             Ken Goecke
  11.         for having written the excellent program
  12.             READER
  13.         that you'll be using for these sessions!! */
  14.  
  15. You can use it's menu to change to colors and scroll speed. The buttons
  16. are self-explanatory.
  17.  
  18. ________________________________________________________________________________
  19.  
  20.  Getting started 
  21.  
  22.     Wouldst that there was a single string we could take hold of at this
  23. point, one that would take us all the way through to the end: your understanding
  24. how to make your Amiga "sing" from the CLI.
  25.  
  26.     There's not! I, for one, wish this had been the case for I have dearly
  27. struggled! Also, if this had been the case, there probably wouldn't have been
  28. any need for all this and it would have saved me hours of typing, a skill I also
  29. lack. 
  30.  
  31.     So we're faced with a sort of electronic Gordian Knot. We have to start
  32. somewhere and have to get to the end, somehow. The beginning is the worst since
  33. there are several things that interrelate and form the basis for enlightenment,
  34. as we are forced to deal with it.
  35.  
  36.     I've used "The AmigaDOS Manual, Second Edition", Bantam Books, 1987 
  37. and "AmigaDOS User's Manual", Commodore-Amiga, 1985 ,both by Tim and Jessica
  38. King as general references throughout my experience with the Amiga and would
  39. suggest that if you don't have these books already, buy them!!
  40. This tutorial cannot go into everything, frankly I'm doing this out of love of
  41. the Amiga and it's cutting deeply into my messing around time. I suspect that
  42. places where I may be ambiguous could be cleared up with a little reading and
  43. some time experimenting at the keyboard.
  44.  
  45.     During the testing of this tutorial, various comments were made
  46. that I should install one or another "SunMouse" or automatic window activator
  47. programs to make it easier. Well, sorry! You're going to have to activate the
  48. window you want to type in manually. Even though I have one of the
  49. aforementioned style programs installed on my workbench, one still has to
  50. remember to move the pointer into the right window.
  51.     Therefore, pay attention! Read the instructions and follow them. If they
  52. say to type a command into the top window, please do it and don't type it into
  53. the bottom one. This is primarily due to the fact that READER doesn't have a
  54. drag bar and will cause you more problems than simply making sure you're typing
  55. into the right window before you hit <RETURN>.
  56.     If you don't already know, to activate a window, simply put the pointer
  57. in it and click the left mouse button.
  58.  
  59.     For those of you who wish I'd used shorter textfile names...it's good
  60. practice making sure you type the right thing.
  61.  
  62.     Due to the other demands on my time while writing this, I didn't always
  63. reconstruct the entire section I was working on in RAM:. Therefore there may
  64. be a place or two that I forgot to mention a file in the list of what you should
  65. expect to find. Well, aren't you glad we're not doing brain surgery? But, if you
  66. bring the specifics to my attention, I'll correct them. It's surprising that in
  67. spite of proof-reading something, after a while you SEE what it's SUPPOSED to
  68. say and not's what's actually there. 
  69.  
  70.     I've done my best to present these concepts and MY experiences with them
  71. as best I can. If you're more experienced than I and discover errors or have a
  72. better way to explain something while looking over the shoulder of one of your
  73. charges, please let me know. I can be reached either by E-mail to Hemonculus,
  74. on PLINK, or by "rainorshine" express to:
  75.  
  76.             Jeff Petermann
  77.             151 Bunker Hill Rd
  78.             Fayetteville NC 28314
  79.  
  80.  
  81.     So, let's get on with it...
  82.     
  83. ________________________________________________________________________________
  84.  
  85.     So here are the ground rules...        
  86.     ...and some funky syntax I've used..   
  87.  
  88. Phrases with "/*" and "*/" around  them  like /* this */, are comments
  89. and as such will only cause error  messages  if typed in at the CLI prompt.
  90. /* Obviously, you shouldn't do it then! */
  91.  
  92. Phrases that begin with ">>" are  meant  to be typed in at that prompt
  93. in your LOWER window! They will be as exact as I can make them allowing for the
  94. fact that I don't know specific names of disks and files that you might have.
  95. That shouldn't be too much of a problem since we'll be working with this disk
  96. only.
  97.  
  98. Phrases that begin with "BS>" should NOT be typed into the CLI.
  99. They illustrate syntax only.
  100.  
  101. Phrases enclosed by "<>" should be  considered  representations of the
  102. literal key. ie: <ESC>-the escape key, <SPACE>-the space bar, <CTRL>-the
  103. control key, etc.
  104.  
  105.  Some basic definitions: 
  106.  
  107. FILENAME: a wildcard /* a symbolic representation that's used to
  108. match anything */ that matches a specific, but unnamed file we may use as an
  109. example.
  110.     Files can be machine language instructions /* binary, hexadecimal, etc
  111. */ or text. Amigas use ASCII /* American   Standard  for  Computer  Information
  112. Interchange */ key codes. These codes tell the computer what letter to "print"
  113. on the screen as it "reads" a text file..it's rather stupid, it only knows 1's
  114. and 0's. So when it reads the number "65" it will print "A", etc.
  115. /* Some word processors save their files in their own format and therefore 
  116. aren 't pure ASCII /* pronounced "ass-key" or "ask e", if you prefer */. 
  117.     Files, no matter what the format, are the molecules of our world and the
  118. smallest unit of data we can retrieve at this level of skill.
  119.  
  120. DIRECTORY is a user-definable area  of  storage.  Though  not
  121. REQUIRED for your work, just like the drawers /*  which  IS  another term you
  122. might hear referring to a directory */ in a filing cabinet, they almost always
  123. simplify you're being able to locate and recover  data. A directory can contain
  124. both files and sub-directories. The disk itself is a directory /* !!! */ and
  125. therefore the maximum size of any one directory, given the current technology is
  126. 880k bytes /* minus the various overhead */.
  127.  
  128. DISKNAME is a generic wildcard used to match the name of any disk
  129. we might be talking about EXACTLY as it  appears  under the disk icon /* upper
  130. right-hand corner of  the  workbench  screen,  unless  you've  changed it's
  131. position */ or as it appears in the  far  right-hand  column if you type in
  132. the command INFO at the prompt.
  133.  
  134. Try that in your lower window now:
  135.  
  136. >> INFO
  137. /* you'll notice that RAM: doesn't have  anything in the far right column. So
  138. we'll just call it RAM: */
  139.  
  140.    CLI: what it is and what it isn't   
  141.  
  142. What the CLI is is the interface between you and the operating system.
  143. All computers have some sort of operating  system (OS) that enables them to
  144. store data somewhere and, probably more importantly, find it again.
  145. That's all it is.
  146.  
  147. No one "programs" in CLI!
  148.  
  149. In spite of the necessity to carefully think out what you're trying to
  150. accomplish with any BATCHFILE  and  making  sure  that the steps are in the
  151. right order, you're only  practicing  for  the  moment when you spread your
  152. wings and start writing in assembly language, C, or Basic (or whatever!). A
  153. single line from any of the programming languages, typed into the CLI, will not
  154. generate usable results. A single line taken from a batchfile will...almost all
  155. of the time. Programming languages require an intermediary process to make them
  156. useable. C needs to be compiled, assembly needs to be assembled, basic needs
  157. it's interpreter. CLI commands were written in BPCL /* Basic Combined
  158. Programming Language, a predecessor of C */ and have already been through the
  159. process, as a user, you're just stringing several programs together to create
  160. the desired end result.
  161.     There will be times, while gnawing at your fingernails and wondering
  162. why a certain batchfile doesn't react the way you think it should, when you
  163. really do believe you're a programmer. Just don't tell someone that makes a
  164. living at it.
  165.  
  166.  
  167.  
  168. To continue,
  169. Whenever you type in a command  at  the  ">>",  an Amiga goes through,
  170. roughly, the following steps:
  171.  
  172. 1. It "reads" the line you've typed in
  173. 2. It looks along the PATH /* not to be  confused with PATHNAME!! */ to find the
  174. command you specified. The command is the first word in your line.
  175. 3. When it finds the command, it copies  it to RAM: and  performs
  176. whatever operations are required.
  177. 4. Upon completion, it erases the command  from memory and checks
  178. to see if you've given it something  else  to  do..if there's nothing, the 
  179. prompt comes back.
  180.  
  181.  
  182. /* From here forgive me if I seem to be  skipping around but there are
  183. a lot of interrelated points to bring up. */
  184.  
  185.    Current Directory   
  186.  
  187. The first concept to consider is  "current  directory". This is simply
  188. the directory  that AmigaDOS  is  currently  considering  "home". It's sort of
  189. an electronic "bookmark" maintained by AmigaDOS to keep it's place and so it
  190. knows what it can "see" at any given time.
  191.  
  192. This is important for several reasons.
  193.  
  194.     First, AmigaDOS looks in this  directory  for  any command given through
  195. the CLI before going further along the  path (ya, I remember, we're getting
  196. to it!).
  197.     Secondly, some programs  write  the  results  of  their  labors to the
  198. current directory. This may or may  not  be  where you want them and you'll
  199. have to plan your attack accordingly.
  200. And some programs require that they  be  able  to find certain data in
  201. the current directory.
  202.  
  203.     Conveniently enough, the  command  that  allows  you  to determine the
  204. current directory or change it is called "CD".
  205.  
  206. >> CD
  207. /* After boot-up, should have been told "DF0:" */
  208.  
  209.     Whenever you  type  in  "DIR",  you  get  a  listing  of  the  current
  210. directory.
  211.  
  212. >> DIR
  213. /* you'll get a listing of everything that's in the root directory of
  214. Tutor: */
  215. >> CD examples
  216. >> DIR
  217. First (dir)      /* See what I mean? */
  218. text
  219. >> CD df0:
  220.  
  221.     Two quick items of interest here. First notice "examples" doesn't have
  222. any ":" or "/". Since it's in the current  directory, it doesn't need them.
  223. Second, the CD status can be changed  back  to the root directory either by
  224. DISKNAME or by simply using the device name.
  225.  
  226. >> CD
  227. Tutor:              /* I'm going to begin putting in the results you should
  228. expect rather than keep repeating "You should have gotten..." */
  229.  
  230.     One more point, if you forget to  specify  the  proper PATHNAME AmigaDOS
  231. will only look in the current directory  and if it fails to find the object
  232. of the search there, it will  give  you  an  ERROR  205 message (object not
  233. found)
  234.  
  235.  
  236. PATHNAMES
  237.  
  238. "PATHNAME" refers to the name of the  disk,  any  and all directories,
  239. and the FILENAME.  /*  the  FILENAME  might  be  tacked  on   the  end like
  240. PATHNAME/FILENAME if I happen to know what we're looking for */
  241.  
  242. For a computer to be able to find anything,  you have to tell it where
  243. to look. It's only fair. The  way  your  Amiga  knows how to find things is
  244. that you tell it  by means of punctuation where it has to look.
  245.  
  246. A colon ":" is used to tell it when it's supposed to be looking for/on
  247. a device /* like df0:, df1:, ram:,  etc)  */. Directories are followed
  248. by a slash "/" /* it's the one on  the  key  with  the  question mark
  249. not to be confused with the backslash "\" next to <BACK SPACE> */
  250. These two characters are the  ones  you'll  need  to be concerned with
  251. when entering commands in the CLI. All  the other characters can be used in
  252. valid FILENAMEs, though experience might  steer you away from some of them.
  253. Spaces <SPACE> can  be  used,  but  you'll  have  to  enclose  the lines in
  254. quotation marks """ and since  they're  way  more painintheass than they're
  255. worth, should be avoided. The  underscore  "_" is a good replacement if you
  256. want to separate words in a name like:     My_Directory/This_File.
  257.  
  258. Upper and lower cases are ignored except when COPYing something /* COPY
  259. will name the destination file whatever you type in */.
  260. And while  we're  talking  about  typing. 
  261. Spelling  is  of  paramount importance!!!
  262. There is a world of  difference  between  /*  look  at them closely */
  263. "df0:" and "df0"!!!
  264.  
  265. "df0:" means a device whereas  "df0"  could  be  anything, but "DF0:",
  266. "dF0:", Df0:", and "df0:" all mean exactly the same thing.
  267. So by PATHNAME, I mean:
  268.  
  269.  device:directory/subdirectory/subdirectory/filename 
  270.  
  271. or whatever combination will get you  to  the file you're going after. Some
  272. examples of various PATHNAMEs on the workbench disk we're using:
  273. df0:devs/printers/generic
  274. df0:s/startup-sequence
  275. Tutor:CLI
  276.  
  277. You can tell they all start with a device (or drive) or diskname, some
  278. have one or more directories  in  them,  but  ALL of them end with a single
  279. FILENAME.
  280.  
  281.  
  282. Now consider Tutor:.
  283. How many different ways are there to find out what's on that disk? Or
  284. how many different PATHNAMEs do we have to it?
  285.  
  286. >> CD df0:
  287. >> CD
  288. Tutor:        /* just making sure! BTW, notice that when you first typed in CD
  289. AmigaDOS told you "DF0:" and now even after CDing TO DF0: it tells you the
  290. DISKNAME */
  291. >> DIR        /* looks at the current directory */
  292. /* You should have gotten a  listing  of  what's  on the disk. Since a disk
  293. meets all the requirements of a  directory,  this is some times referred to
  294. as the "root" directory. */
  295. >> DIR Tutor:    /* looks by DISKNAME */
  296. >> DIR sys:    /* looks at assignment */
  297. >> DIR df0:    /* looks in the device */
  298.  
  299.     That took a while but it proved my point. Those are all valid PATHNAMEs
  300. to the same place, but not all things are that easy...but you expected that.
  301.  
  302. Now try:
  303.  
  304. >> CD examples/first
  305. >> DIR
  306. Hi_there
  307.  
  308.     In this second instance, I might  have  said  PATHNAME/Hi_there if YOU
  309. knew what the PATHNAME was.
  310.  
  311. >> CD Tutor:    /* so I don't get confused */
  312.  
  313.  
  314.  
  315.  
  316. BATCHFILE is a textfile that contains  a series of CLI commands that
  317. performs some certain operation/operations.  Although similar to a program,
  318. a BATCHFILE is stored as  text that  can  be  edited at will where programs
  319. are, generally, stored as hexadecimal or  binary  numbers. 
  320.     The  startup-sequence  in the Tutor:s directory is a BATCHFILE.
  321.  
  322.  
  323.    Accepted Conventions   
  324.  
  325. []    square brackets indicate optional information, but can provide
  326. useful data to AmigaDOS as to how you want an event handled.
  327.  
  328. |    vertical bars indicates alternatives.
  329.  
  330.  
  331.    On-Line Assistance   
  332.  
  333.     The AmigaDOS commands are written so that if you don't remember the
  334. correct syntax for a command, you can type the command followed by a question
  335. mark "?" in at the prompt and get a usage message:
  336.  
  337. BS> COMMAND ?
  338.  
  339.     This sounds great, but the messages are sometimes pretty cryptic. For
  340. example:
  341.  
  342. >> LIST ?
  343. DIR,P=PAT/K,KEYS/S,DATES/S,NODATES/S,TO/K,S/K,SINCE/K,UPTO/K,QUICK/S:
  344.  
  345.     We're not going to get into this particular command right now, but we
  346. will have a quick look at what information can be extracted from the help
  347. statement.
  348.  
  349.     At the start of the line, you'll see "DIR", that means "what directory
  350. do you want to have LISTed. If you wanted to know about df0:s, you'd type:
  351.  
  352. BS> LIST df0:s
  353.  
  354.     The equal sign "=" between the "P" and "PAT" is used to denote an
  355. abbreviation that AmigaDOS will recognize.
  356. The rest of the line is taken up by words followed by a slash "/" and a
  357. single letter. The "/letter" tells you how the preceding word is treated by
  358. the command.
  359.  
  360.     /S    means a switch. If you use the word in the command
  361. line, without the "/S", that tells AmigaDOS to "turn on" that particular
  362. option. A "/S" option is not required for the command to work and takes no
  363. additional information.
  364.  
  365.     /K    means a keyword. This will tell AmigaDOS that it needs
  366. to process the result in a certain manner, as specified by the word you use.
  367. A keyword MUST be followed by additional information for the command to function
  368. properly. For example, the keyword "TO", how could you expect the command to
  369. work if you didn't tell it where you wanted the information sent?
  370.  
  371.     /A    means an argument. This is used to indicate
  372. information that will assist AmigaDOS in determining what to do. These are
  373. your parameters. The "/A" WORDS are usually optional and function primarily
  374. to make it easier for the USER, not AmigaDOS, to know what's going on,
  375. The information that is requested by a "/A" IS NOT OPTIONAL!!
  376.  
  377.  
  378.     Even though LIST doesn't have any "/A" words, they do exist. Let's look
  379. at the help line from FILENOTE.
  380.  
  381. BS> FILENOTE ?
  382. FILE/A,COMMENT/A:
  383.  
  384.     This means that FILENOTE requires that you tell it both the file
  385. to want to attach the comment to and the comment you want to attach.
  386.  
  387.  
  388. BS> FILENOTE [pathname/]filename [COMMENT] your_comment_here
  389.  
  390.     I have the "[pathname/]" as an option, since if the file was in
  391. the current directory, it wouldn't be necessary. Otherwise, it would be!
  392.  
  393.  
  394.  
  395.     One last thing before we move on, in the helpful hints catagory,
  396. if you TYPE a file and want to be able to read it before it scrolls off the
  397. top of the screen, use <SPACE> to stop it. Use <BACK SPACE> to start it
  398. scrolling again.
  399.  
  400.  
  401. That should at least get us off on the same foot.
  402.  
  403. ________________________________________________________________________________
  404.  
  405.      /* get some popcorn time */     
  406.  
  407.     If you feel like you need a little visual stimulation at this point,
  408. there's a little film on this disk you can watch. Here's how...
  409.  
  410. >> CD film
  411. >> projector CLI.film
  412.  
  413.  
  414.       /* or you can just forget it, if you've been following along so far */
  415.  
  416. ________________________________________________________________________________
  417.  
  418.  Now we'll get into the commands: 
  419.  
  420. /* Read the rest of the file BEFORE you perform the actions, if you quit
  421. the Reader BEFORE you read the command you'll need to type in, you'll have
  422. to scan through this whole file again */
  423.  
  424.  
  425.     Now, all you need to do is:
  426.  
  427. Select "Return to Main Screen" from the upper window menu /* click on READER
  428. somewhere to be sure it's active */
  429.  
  430.     When the screen returns to the normal color, click in the UPPER window
  431. and type:
  432.  
  433. Reader CLI_tutorial.1
  434.  
  435. at the prompt.
  436.  
  437.